<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../template/AdminTemplate.xhtml">

    <ui:define name="contentInsert">
        
        <h3>Generate Lucky Draw</h3>
        <h:form>
                    <p:panel id="panel" >
                        <p:ajaxStatus style="width:16px;height:16px;">
                            <f:facet name="start">
                                <h:graphicImage value="http://www.primefaces.org:8080/showcase/design/ajaxloading.gif" />
                            </f:facet>
                            <f:facet name="complete">
                                <h:outputText value="" />
                            </f:facet>
                        </p:ajaxStatus>
                        <p:messages />
                        <h:panelGrid columns="3">
                            <h:outputLabel for="luckydrawWinners" value="Generate Lucky Draw Winners:"/>             
                        </h:panelGrid>
                        <h:commandButton id="submitNewStakeholder" value="Generate Winners" onclick="if (!confirm('Are you sure you want to generate lucky draw winners?')) return false"
                                         actionListener="#{luckyDrawMB2.generateLuckyDrawWinners(event)}"
                                    />                 
                    </p:panel>
                </h:form>
                <br/>
                <br/>
                
                <h:form> 
            <p:dataTable value="#{luckyDrawMB2.getUser()}" var="o" paginator="true" rows="15"
                         styleClass="order-table"
                       
                         >

                <p:column>

                    <f:facet name="header">Email</f:facet>
                    #{o.email}
                </p:column>
                <p:column>

                    <f:facet name="header">Customer Tier</f:facet>
                    #{o.customerTier.name.toString()}
                </p:column>
                <p:column>

                    <f:facet name="header">D.O.B</f:facet>
                    #{o.birthDate}
                </p:column>

               
            </p:dataTable>            
        </h:form>

    </ui:define>
</ui:composition>

